package com.thekernel.youdaoyun.service;

import com.thekernel.youdaoyun.bean.Star;
import com.thekernel.youdaoyun.exception.MyException;
import org.springframework.stereotype.Repository;

/**
 * @Author TheKernel
 * @Date 2019/9/13 7:37 下午
 * @Version 1.0
 * @Description 收藏 业务层
 */
@Repository
public interface StarService {

    /**
     * 添加收藏
     * @param star 收藏信息(star_note, star_user必需)
     * @return -1: Data Not Found 0: Star Already Exists 1: Success
     */
    int addStar(Star star);

    /**
     * 取消收藏
     * @param starId 收藏 id
     * @param userId 用户 id
     * @return -1: Data Not Found 0: Star Not Found 1: Success
     * @throws MyException 非本人操作等
     */
    int cancelStar(long starId, long userId) throws MyException;

    /**
     * 查询收藏
     * @return 收藏列表
     * @throws MyException 非本人操作等
     */
    Star[] queryStar() throws MyException;

}
